package dao;

import java.sql.Connection;
import java.sql.SQLException;

import jdbc.JdbcClienteDAO;

import util.ConnectionFactory;

public class jdbcDAOFactory extends DAOFactory {

	
	private Connection connection;
	
	
	public jdbcDAOFactory(){
		
		try {
			this.connection = ConnectionFactory.getConnection();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
	}
	public void closeConection() {
		
		if(this.connection != null){
			try {
				this.connection.close();
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}

	}

	
	public ClienteDAO getClienteDAO() {
		return new JdbcClienteDAO(this.connection);
	}

}
